home *** CD-ROM | disk | FTP | other *** search
-
-
-
- VVVVkkkkGGGGeeeettttRRRReeeessssoooouuuurrrrcccceeee((((3333xxxx)))) VVVVkkkkGGGGeeeettttRRRReeeessssoooouuuurrrrcccceeee((((3333xxxx))))
-
-
-
- NNNNAAAAMMMMEEEE
- VkGetResource - Convenience functions for retrieving resources
-
- HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE
- #include <Vk/VkResource.h>
-
- FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS
- char * VkGetResource(const char *name,
- const char *className);
-
- XtPointer VkGetResource(Widget w,
- const char *names,
- const char *classNames,
- const char *desiredType,
- const char *defaultValue);
-
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- These functions provide simple ways to retrieve resources. The
- first form retrieves a resource by name and class name from the
- application's resource database relative to the entire application.
- The second form allows applications to retrieve a a resource
- relative to a specific widget. The resource can be specified as a
- dot-separated list of names and classes, allowing "virtual" sub-
- resources to be retrieved. The second form also allows a target
- type to be specified. VkGetResource will convert the retrieved
- value, (or the default value if no value is retrieved), to the
- specified type.
-
- EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
- Suppose an application wishes to draw an image and wishes to allow
- the user to select various aspects of the style in which the image
- is drawn. For example, each style might include a color and fill
- pattern (a pixmap) with which it is drawn. Each aspect of each
- style could be specified as a resource which could be retrieved as
- follows.
-
- Widget shell = XtAppInitialize(/* args */ );
-
- Widget canvas = XmCreateDrawingArea(shell, "canvas",
- NULL, 0);
-
- Pixel fgOne = (Pixel) VkGetResource(canvas,
- "styleOne.foreground",
- "Style.Foreground",
- XmRString, "Black");
-
- Pixel fgTwo = (Pixel) VkGetResource(canvas,
- "styleTwo.foreground",
- "Style.Foreground",
- XmRString, "Black");
-
-
-
-
- PPPPaaaaggggeeee 1111
-
-
-
-
-
-
- VVVVkkkkGGGGeeeettttRRRReeeessssoooouuuurrrrcccceeee((((3333xxxx)))) VVVVkkkkGGGGeeeettttRRRReeeessssoooouuuurrrrcccceeee((((3333xxxx))))
-
-
-
- Pixel fgThree = (Pixel) VkGetResource(canvas,
- "styleThree.foreground",
- "Style.Foreground",
- XmRString, "Black");
-
- Pixel bgOne = (Pixel) VkGetResource(canvas,
- "styleOne.background",
- "Style.Background",
- XmRString, "White");
-
- Pixel bgTwo = (Pixel) VkGetResource(canvas,
- "styleTwo.background",
- "Style.Background",
- XmRString, "White");
-
- Pixel bgThree = (Pixel) VkGetResource(canvas,
- "styleThree.background",
- "Style.Background",
- XmRString, "White");
-
- Pixmap pixOne = (Pixmap) VkGetResource(canvas,
- "styleOne.pixmap",
- "Style.Pixmap",
- XmRString, "background");
-
- Pixmap pixTwo = (Pixmap) VkGetResource(canvas,
- "styleTwo.pixmap",
- "Style.Pixmap",
- XmRString, "background");
-
- Pixmap pixThree = (Pixmap) VkGetResource(canvas,
- "styleThree.pixmap",
- "Style.Pixmap",
- XmRString, "background");
-
- These calls attempt to load a resource by the complete resource
- specification:
-
- shell.canvas.styleOne.foreground
-
- and so on. All of the usual wild card uses apply. Data returned by
- VkGetResource() should not be freed.
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- _V_i_e_w_K_i_t _P_r_o_g_r_a_m_m_e_r'_s _G_u_i_d_e
- _T_h_e _X _W_i_n_d_o_w _S_y_s_t_e_m, DEC Press, Bob Sheifler and Jim Gettys
- _T_h_e _X _W_i_n_d_o_w _S_y_s_t_e_m _T_o_o_l_k_i_t, DEC Press, Paul Asente and Ralph Swick
- _T_h_e _O_S_F/_M_o_t_i_f _P_r_o_g_r_a_m_m_e_r_s _R_e_f_e_r_e_n_c_e, Prentice Hall, OSF
-
-
-
-
-
-
-
- PPPPaaaaggggeeee 2222
-
-
-
-